package com.lucene.service;

import com.lucene.mapper.ContactMapper;
import com.lucene.model.Contact;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by zhangzhen on 26/10/2017.
 */
@Service("contactService")
public class ContactService {

    @Autowired
    private ContactMapper contactMapper;

    public Contact searchByName(Contact contact){
        return contactMapper.searchByName(contact);
    }
    public int insertContact(Contact contact){
        return contactMapper.insertContact(contact);
    }
    public List<Contact> getAllContacts(){
        return contactMapper.getAllContacts();
    }
    public int updateContact(Contact contact){
        return contactMapper.updateContact(contact);
    }
}
